// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v4.25.1
// source: grpcproxy/proto/v1/grpcproxy.proto

package v1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// HTTPProxyClient is the client API for HTTPProxy service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type HTTPProxyClient interface {
	Run(ctx context.Context, opts ...grpc.CallOption) (HTTPProxy_RunClient, error)
}

type hTTPProxyClient struct {
	cc grpc.ClientConnInterface
}

func NewHTTPProxyClient(cc grpc.ClientConnInterface) HTTPProxyClient {
	return &hTTPProxyClient{cc}
}

func (c *hTTPProxyClient) Run(ctx context.Context, opts ...grpc.CallOption) (HTTPProxy_RunClient, error) {
	stream, err := c.cc.NewStream(ctx, &HTTPProxy_ServiceDesc.Streams[0], "/HTTPProxy/Run", opts...)
	if err != nil {
		return nil, err
	}
	x := &hTTPProxyRunClient{stream}
	return x, nil
}

type HTTPProxy_RunClient interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ClientStream
}

type hTTPProxyRunClient struct {
	grpc.ClientStream
}

func (x *hTTPProxyRunClient) Send(m *Packet) error {
	return x.ClientStream.SendMsg(m)
}

func (x *hTTPProxyRunClient) Recv() (*Packet, error) {
	m := new(Packet)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// HTTPProxyServer is the server API for HTTPProxy service.
// All implementations must embed UnimplementedHTTPProxyServer
// for forward compatibility
type HTTPProxyServer interface {
	Run(HTTPProxy_RunServer) error
	mustEmbedUnimplementedHTTPProxyServer()
}

// UnimplementedHTTPProxyServer must be embedded to have forward compatible implementations.
type UnimplementedHTTPProxyServer struct {
}

func (UnimplementedHTTPProxyServer) Run(HTTPProxy_RunServer) error {
	return status.Errorf(codes.Unimplemented, "method Run not implemented")
}
func (UnimplementedHTTPProxyServer) mustEmbedUnimplementedHTTPProxyServer() {}

// UnsafeHTTPProxyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to HTTPProxyServer will
// result in compilation errors.
type UnsafeHTTPProxyServer interface {
	mustEmbedUnimplementedHTTPProxyServer()
}

func RegisterHTTPProxyServer(s grpc.ServiceRegistrar, srv HTTPProxyServer) {
	s.RegisterService(&HTTPProxy_ServiceDesc, srv)
}

func _HTTPProxy_Run_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(HTTPProxyServer).Run(&hTTPProxyRunServer{stream})
}

type HTTPProxy_RunServer interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ServerStream
}

type hTTPProxyRunServer struct {
	grpc.ServerStream
}

func (x *hTTPProxyRunServer) Send(m *Packet) error {
	return x.ServerStream.SendMsg(m)
}

func (x *hTTPProxyRunServer) Recv() (*Packet, error) {
	m := new(Packet)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// HTTPProxy_ServiceDesc is the grpc.ServiceDesc for HTTPProxy service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var HTTPProxy_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "HTTPProxy",
	HandlerType: (*HTTPProxyServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Run",
			Handler:       _HTTPProxy_Run_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "grpcproxy/proto/v1/grpcproxy.proto",
}
